namespace Digitalmes.Application.Mes;

/// <summary>
/// 设备警报记录表
/// </summary>
public sealed class EquipAlarmRecordDto : Dto
{
    /// <summary>
    /// 产线编号
    /// </summary>
    public string? LineCode { get; set; }

    /// <summary>
    /// 产线名称
    /// </summary>
    public string? LineName { get; set; }

    /// <summary>
    /// 设备编号
    /// </summary>
    public string? EquipCode { get; set; }

    /// <summary>
    /// 设备名称
    /// </summary>
    public string? EquipName { get; set; }

    /// <summary>
    /// 警报内容
    /// </summary>
    public string? Content { get; set; }

    /// <summary>
    /// 警报等级
    /// </summary>
    public AlarmLevelEnum Level { get; init; }

    /// <summary>
    /// 警报分类
    /// </summary>
    public string? Classify { get; set; }

    public string? LevelDesc => Level.Description();

    /// <summary>
    /// 开始时间
    /// </summary>
    public DateTime StartTime { get; set; }

    /// <summary>
    /// 结束时间
    /// </summary>
    public DateTime? EndTime { get; set; }

    /// <summary>
    /// 警报时长 (分钟)
    /// </summary>
    public decimal Duration { get; set; }

    /// <summary>
    /// 警报状态（1->警报中; 2->已关闭）
    /// </summary>
    public int Status { get; set; }
}
